package coml.jiyun.hp.wanandroid.model;

import coml.jiyun.hp.wanandroid.base.BaseModel;
import coml.jiyun.hp.wanandroid.bean.BannerBean;
import coml.jiyun.hp.wanandroid.bean.SystemBean;
import coml.jiyun.hp.wanandroid.net.HttpUtil;
import coml.jiyun.hp.wanandroid.net.ResultCallBack;
import coml.jiyun.hp.wanandroid.net.ResultSubscriber;
import coml.jiyun.hp.wanandroid.net.RxUtils;

public class BannerModel extends BaseModel {
    public void getBanner(final ResultCallBack<BannerBean> callBack){
        addDisposable(HttpUtil
                .getInstance()
                .getApiServer()
                .getBanner()
                .compose(RxUtils.<BannerBean>rxSchedulerHelper())
                .subscribeWith(new ResultSubscriber<BannerBean>() {
                    @Override
                    public void onNext(BannerBean bannerBean) {
                        callBack.onSuccess(bannerBean);
                    }
                }));
    }


}
